package client;

import java.io.File;
import javax.swing.filechooser.*;

/** This class extends the functionality of the FileFilter class,
 *  hence when the user selects a file in the file chooser only those
 *  which can be processed by the application are shown
 * 	
 * 	@author Daniel Hutchinson
 *	@version 1.0
 */
public class ImageFileFilter extends FileFilter {

	public boolean accept(File f) {
		if(f.isDirectory()){
			return true;
		}

		String ext = f.getName().substring(f.getName().indexOf('.') + 1);
		
		if(ext.equalsIgnoreCase("tiff")){
			return true;
		}else if(ext.equalsIgnoreCase("bmp")){
			return true;
		}else if(ext.equalsIgnoreCase("jpg")){
			return true;
		}
		
		return false;
	}

	public String getDescription() {
		return "Uncompressed Images";
	}

}
